package com.cheer.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cheer.dao.ReferenceSpecialDao;
import com.cheer.entity.ReferenceSpecialEntity;
import com.cheer.service.ReferenceSpecialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("referenceSpecialService")
public class ReferenceSpecialServiceImpl extends ServiceImpl<ReferenceSpecialDao, ReferenceSpecialEntity> implements ReferenceSpecialService {

    @Autowired
    private ReferenceSpecialDao referenceSpecialDao;

    @Override
    public ReferenceSpecialEntity listByAccountId(Long accountId, String yyyy) {

        List<ReferenceSpecialEntity> referenceSpecialEntitys = referenceSpecialDao.listByAccountId(accountId, yyyy);
        if(CollectionUtil.isEmpty(referenceSpecialEntitys)){
            return null;
        }
        return referenceSpecialEntitys.get(0);
    }
}